<html>
<head>
    <meta charset="UTF-8">
    <title>新闻展示</title>
    <link rel="stylesheet" type="text/css" href="css/news.css">
    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="https://unpkg.com/vue"></script>
    <script>
        $(function(){
            $("#public").load("./public.html");
        });
    </script>
    <meta http-equiv="Access-Control-Allow-Origin" content="http://10.101.147.7/htdocs/7yue/tp5/public/index/index/index">
</head>
<body>
<div id="app">
	<div id="public"></div>
	<div class="news_top">
        <span style="margin-left: 30px; font-size: 18px" >新 闻 展 示 </span>
		<a href="news_add.html" class="news_add_title">+新闻添加</a>
	</div>
    <div class="news_list_main" align="center">
        <table width="86%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
            <tr>
                <th width="100" align="center">新 闻 标 题</th>
                <th align="center">新 闻 内 容</th>
                <th width="70" align="center">新 闻 分 类</th>
                <th width="50" align="center">是 否 推 荐</th>
                <th width="50" align="center">展示导航栏</th>
                <th width="50" align="center">新 闻 排 序</th>
                <th width="60" align="center">上 传 时 间</th>
                <th width="70" align="center">作 者</th>
                <th width="70" align="center">审 核 状 态</th>
                <th width="60" align="center">点 击 率</th>
                <th width="80" align="center">操 作</th>
            </tr>
            <tr class="news_tr" v-for="val in News_Content.news">
                <td align="center">{{val.news_id}}</td>
                <td align="center">{{val.news_desc}}...<a href="news_content.html">查看全文</a></td>
                <td align="center">{{val.cate_name}}</td>
                <td align="center" v-if="val.news_isposn!=1"><img src="images/no.gif"></td>
                <td align="center" v-else-if="val.news_isposn==1"><img src="images/yes.gif"></td>
                <td align="center" v-if="val.news_ishead!=1"><img src="images/no.gif"></td>
                <td align="center" v-else-if="val.news_ishead==1"><img src="images/yes.gif"></td>
                <td align="center">{{val.news_order}}</td>
                <td align="center">{{val.news_create_time}}</td>
                <td align="center">{{val.news_edit}}</td>
                <td align="center" v-if="val.news_status==0"><img src="images/yes.gif"></td>
                <td align="center" v-else-if="val.news_status==1"><img src="images/no.gif"></td>
                <td align="center">{{val.news_read}}</td>
                <td align="center"><a href="news_update.html">编辑</a> | <a href="#">删除</a></td>
            </tr>
        </table>
    </div>
</div>
<script src="http://cdn.bootcss.com/vue/2.1.0/vue.js" type="text/javascript" charset="utf-8"></script>
<script src="http://cdn.bootcss.com/vue-resource/1.0.3/vue-resource.js" type="text/javascript" charset="utf-8"></script>
<script>
    new Vue({
        el:'#app',
        data: {
            News_Content:[],
            news_content_url: 'http://10.101.147.7/htdocs/7yue/tp5/public/index/index/index'  //存数据接口
        },
        created: function(){
            this.getImg() ;      //定义方法
        },
        methods: {
            getImg: function(){
                var that = this;
                that.$http({      //调用接口
                    method:'GET',
                    url:this.news_content_url //this指data
                }).then(function(response){ //接口返回数据
                    console.log(response.data);
                    //this.News_Content=response.data;
                },function(error){
                    console.log(error);
                })
            }
        }
    })
</script>
</body>
</html>